/**
 * 主题功能
 * */
layui.define(["sdLocal"], (exports) => {
    let sdLocal = layui.sdLocal;

    let sysTheme = {
        initTheme: function() {
            let session = sdLocal.session();
            if(session){
                if(session.theme){
                    $('#theme-style').attr('href', session.theme);
                }
            }
        },
        changeTheme: function(theme) {
            let href = '/assets/css/theme/' + theme + '.css';
            $('#theme-style').attr('href', href);
            sdLocal.set('theme', href);
        },
    }

    exports('sysTheme', sysTheme);
})